-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine socket #34
Combine socket #34
Conversation
# Conflicts: # demo/src/main/java/com/ivanempire/lighthouse/demo/MainActivity.kt # lighthouse/src/commonMain/kotlin/com/ivanempire/lighthouse/core/DiscoveryManager.kt # lighthouse/src/commonMain/kotlin/com/ivanempire/lighthouse/core/RealDiscoveryManager.kt # lighthouse/src/main/java/com/ivanempire/lighthouse/LighthouseClient.kt
emit(discoveryDatagram) | ||
} | ||
} | ||
.catch { cause -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have broken this into multiple commits, sorry.
This is a bit tricky to notify with flows. If the connection gets closed, we should handle it gracefully. Also, it would be nice to notify the user. Perhaps the top level data passed to the user should include a connection state.
val datagramPacketRequest = searchRequest.toDatagramPacket(multicastGroup) | ||
|
||
repeat(retryCount + 1) { | ||
if (!multicastSocket.isClosed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to fix a crash I experienced. Not sure why the socket wasn't open, but there are apparently times when it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing you've seen this on desktop? Or did you observe this on Android?
Closing for now since we're both async on this work - feel free to reopen :) |
No description provided.